﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Rose.Models.SelfModel>" %>
<%@ Import Namespace="Rose.Helper" %>
 <% Rose.Helper.CheckRelationHelpModel helper = new Rose.Helper.CheckRelationHelpModel();
      
     string selfId = new CheckHelpModel().CheckCurrentUserId();
     bool isSelf=(selfId==Model.UserId)?true:false;
       %>

    <%if(isSelf){ %>

     <div id="self">
 <%string selfname = "完善资料"; if (!string.IsNullOrEmpty(Model.Name)) { selfname = Model.Name; } %>


<div>
<div><a class="friendalbum" onclick="FriendAlbum(this);" data="<%=Model.UserId %>"><img id="selfimage" src="<%=Model.ImagePath %>" /></a></div>
<div id="selfname"><p><a href="<%=Url.Action("ManageUserInfo","Account") %>">
<%=selfname %>


</a></p>
<p>积分：<span><%=Model.Score %></span></p>
</div>
</div>

<div id="selfdata">
<p><a href="<%=Url.Action("ShowFriendList","Relation",new{currentpage=1}) %>">好友人数：<span id="a"><%=Model.FriendCount %></span></a></p>
<p><a href="<%=Url.Action("ShowFocusList","Relation",new {currentpage=1}) %>">关注人数：<span id="b"><%=Model.FocusCount %></span></a></p>
<p><a href="<%=Url.Action("ShowRequestFromOthers","Relation") %>">好友邀请：<span id="c"><%=Model.RequestCount %></span></a></p>
</div>
<div id="d"><p><a>收到好友一份礼物</a></p></div>
</div>

    <%}else{ %>

    <%--表示用户空间--%>

  <div id="self">
 <%string selfname = "未完善"; if (!string.IsNullOrEmpty(Model.Name)) { selfname = Model.Name; } %>


<div>
<div><a class="friendalbum"
 <%if(helper.IsFriendRelation(selfId,Model.UserId)){ %>onclick="FriendAlbum(this);" <%}else{ %>
 onclick="PublicAlbum(this);"<%} %>

data="<%=Model.UserId %>"><img id="selfimage" src="<%=Model.ImagePath %>" /></a></div>

<div id="selfname"><p><a href="<%=Url.Action("FriendInfo","FriendTrend",new{friendId=Model.UserId}) %>">
<%=selfname %></a></p>



<p>积分：<span><%=Model.Score %></span></p>
</div>
</div>

<div id="selfdata">
<p><a>好友人数：<span id="a"><%=Model.FriendCount %></span></a></p>

</div>


</div>



    <%} %>

